<template>
    <view class="help-detail">
        <view class="help-title common-interval">
            {{helpDetail.helpTitle}}
        </view>
        <view class="help-content common-interval">
            <parser :html="helpDetail.helpDetails"/>
        </view>
    </view>
</template>

<script>
    import parser from "@/components/jyf-parser/jyf-parser";
    import service from "@/service";
    export default {
        name: "help-detail",
        data(){
            return{
                helpId: '',
                helpDetail: {}
            }
        },
        components: { parser },
        onLoad(params){
            let {helpId} = params;
            this.helpId = helpId;
            this.getHelpDetail(helpId);
        },
        methods: {
            getHelpDetail(){
                uni.showLoading({
                    title: '加载中',
                });
                let params = {
                    helpId: this.helpId
                }
                service.mineService.getHelpDetail({
                    data: params,
                    success: res => {
                        uni.hideLoading();
                        if (res.code === 200) {
                            this.helpDetail = res.result || {}
                        } else {
                            uni.showToast({
                                title: `${res.resultMsg}`,
                                duration: 2500,
                                icon: 'none'
                            });
                        }
                    },
                    fail: ()=>{
                        uni.hideLoading();
                    }
                });
            }
        }
    }
</script>

<style scoped lang="scss">
    .help-detail{
        .help-title{
            margin-top: 20rpx;
            margin-bottom: 20rpx;
        }
        .help-content{
            padding-top: 20rpx;
            border-top: 1rpx solid #E5E5E5;
        }
    }
</style>